﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERPStore.Web.ModelMetadata
{
	public class Required
	{

		public bool AllowEmptyString { get; set; }
		public string ErrorMessage { get; set; }
		public string ErrorMessageResourceName { get; set; }
		public string ErrorMessageResourceType { get; set; }
		public Func<object, bool> Condition { get; set; }
		public bool WithCondtionFor(object model)
		{
			if (Condition == null)
			{
				return true;
			}
			return Condition.Invoke(model);
		}

	}
}
